import { ContainerService } from "shared/component/container/ContainerService";
import EventBinder from "shared/component/event/EventBinder";
import Log4R from "shared/component/log/Log4R";
const loginfo = Log4R.getLog('info');
export class DirectorServiceImpl extends ContainerService<Ctn.DirectorService, Ctn.DirectorEntity> implements Ctn.DirectorService {
    protected serverCalls: (keyof this)[] = [];
    protected serviceName: keyof Ctn.Services = "directorService";
    /**
     * 玩家新增监听
     */
    protected addPlayerEventBinder = new EventBinder<(play: Ctn.player.PlayerEntity) => void>()
    /**
     * 玩家离开监听
     */
    protected removePlayerEventBinder = new EventBinder<(play: Ctn.player.PlayerEntity) => void>()


    onPlayerAdd = this.addPlayerEventBinder.bind()
    onPlayerRemoving = this.removePlayerEventBinder.bind()
    syncPlayerEntity(playerEntity: Ctn.player.PlayerEntity) {
        this.addPlayerEventBinder.callBack(playerEntity)
    }

}